/**
 * Created by IntelliJ IDEA.
 * User: Robin
 * Date: Apr 7, 2009
 * Time: 12:25:20 AM
 * To change this template use File | Settings | File Templates.
 */

public class SecurityFilters {

    def filters = {
        security (controller:'*', action:'*') {
            before = {

              if(!session.userAccount
                && (!(controllerName.equals('userAccount')) && (!(actionName.equals('save')) || !(actionName.equals('create'))))){
              //{}                //if (!session.userAccount && !(controllerName.equals('userAccount'))){//if
                  //&& ((actionName.equals('login') || actionName.equals('create') || actionName.equals('save'))
                    redirect (controller:'userAccount', action:'login')
                 return false

                }
            }
        }
    }

}